/**
 * Copyright (c) 2025 Bytedance Ltd. and/or its affiliates
 * 
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 * 
 *     http://www.apache.org/licenses/LICENSE-2.0
 * 
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 **/

.game-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 20px;
  min-height: calc(100vh - 70px);
}

.game-title {
  font-size: 28px;
  margin-bottom: 20px;
  color: #333;
}

.game-status {
  font-size: 24px;
  margin-bottom: 20px;
  padding: 10px 20px;
  border-radius: 5px;
  font-weight: bold;
}

.black-turn {
  background-color: #333;
  color: white;
}

.white-turn {
  background-color: #f0f0f0;
  color: #333;
  border: 1px solid #ccc;
}

.black-wins {
  background-color: #333;
  color: white;
  animation: pulse 1.5s infinite;
}

.white-wins {
  background-color: #f0f0f0;
  color: #333;
  border: 1px solid #ccc;
  animation: pulse 1.5s infinite;
}

@keyframes pulse {
  0% { transform: scale(1); }
  50% { transform: scale(1.05); }
  100% { transform: scale(1); }
}

.game-board {
  display: grid;
  grid-template-columns: repeat(15, 40px);
  grid-template-rows: repeat(15, 40px);
  gap: 0;
  background-color: #d9b572;
  border: 2px solid #8b5a2b;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
  position: relative;
}

.board-lines {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
}

.board-lines:before,
.board-lines:after {
  content: "";
  position: absolute;
  background: rgba(0, 0, 0, 0.5);
}

.chess-position {
  width: 40px;
  height: 40px;
  display: flex;
  justify-content: center;
  align-items: center;
  position: relative;
  cursor: pointer;
  z-index: 2;
}

.chess-position:before {
  content: "";
  position: absolute;
  top: 50%;
  left: 0;
  right: 0;
  height: 1px;
  background-color: #000;
  opacity: 0.5;
  z-index: -1;
}

.chess-position:after {
  content: "";
  position: absolute;
  left: 50%;
  top: 0;
  bottom: 0;
  width: 1px;
  background-color: #000;
  opacity: 0.5;
  z-index: -1;
}

.chess {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
}

.chess-black {
  background: radial-gradient(circle at 30% 30%, #555, #000);
}

.chess-white {
  background: radial-gradient(circle at 30% 30%, #fff, #ddd);
  border: 1px solid #ccc;
}

.dot {
  width: 8px;
  height: 8px;
  background-color: #000;
  border-radius: 50%;
  position: absolute;
  z-index: 1;
}

.reset-button {
  margin-top: 20px;
  padding: 10px 20px;
  background-color: #4a90e2;
  color: white;
  border: none;
  border-radius: 4px;
  font-size: 16px;
  cursor: pointer;
  transition: background-color 0.2s;
}

.reset-button:hover {
  background-color: #3a7bc8;
}

.game-controls {
  display: flex;
  margin-top: 20px;
  gap: 10px;
}

.undo-button {
  padding: 10px 20px;
  background-color: #e67e22;
  color: white;
  border: none;
  border-radius: 4px;
  font-size: 16px;
  cursor: pointer;
  transition: background-color 0.2s;
}

.undo-button:hover {
  background-color: #d35400;
}

.undo-button:disabled {
  background-color: #ccc;
  cursor: not-allowed;
}

.move-history {
  margin-top: 20px;
  max-height: 200px;
  overflow-y: auto;
  width: 200px;
  border: 1px solid #ddd;
  border-radius: 4px;
  padding: 10px;
  background-color: #f9f9f9;
}

.history-item {
  padding: 5px;
  border-bottom: 1px solid #eee;
  font-size: 14px;
}

.history-item:last-child {
  border-bottom: none;
}

.game-area {
  display: flex;
  gap: 20px;
  align-items: flex-start;
}

.replay-controls {
  margin-top: 20px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  width: 100%;
  max-width: 600px;
}

.replay-buttons {
  display: flex;
  justify-content: center;
  gap: 10px;
}

.replay-play-btn, .replay-pause-btn {
  padding: 10px 20px;
  background-color: #27ae60;
  color: white;
  border: none;
  border-radius: 4px;
  font-size: 16px;
  cursor: pointer;
  transition: background-color 0.2s;
}

.replay-play-btn:hover, .replay-pause-btn:hover {
  background-color: #219653;
}

.replay-play-btn:disabled, .replay-pause-btn:disabled {
  background-color: #ccc;
  cursor: not-allowed;
}

.replay-slider-container {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 10px;
}

.replay-slider {
  flex: 1;
  height: 4px;
  -webkit-appearance: none;
  appearance: none;
  background: #ddd;
  outline: none;
  border-radius: 2px;
}

.replay-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: #4a90e2;
  cursor: pointer;
}

.replay-slider::-moz-range-thumb {
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: #4a90e2;
  cursor: pointer;
  border: none;
}

.current-move {
  font-size: 14px;
  color: #555;
  text-align: center;
}

.share-to-blog-btn {
  padding: 10px 20px;
  background-color: #27ae60;
  color: white;
  border: none;
  border-radius: 4px;
  font-size: 16px;
  cursor: pointer;
  transition: background-color 0.2s;
}

.share-to-blog-btn:hover {
  background-color: #219653;
}

@media (max-width: 600px) {
  .game-board {
    grid-template-columns: repeat(15, 25px);
    grid-template-rows: repeat(15, 25px);
  }
  
  .chess-position {
    width: 25px;
    height: 25px;
  }
  
  .chess {
    width: 21px;
    height: 21px;
  }
  
  .game-area {
    flex-direction: column;
  }
  
  .move-history {
    width: 100%;
  }
}